unit UCadArea;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Modelo, DB, DBTables, Grids, DBGrids, StdCtrls, Buttons,
  CheckLst, ExtCtrls, Mask, DBCtrls, UDPTOUteis;

type
  TFCadArea = class(TFModelo)
    qPadraoARE_DESCRICAO: TStringField;
    qPadraoARE_CODIGO: TIntegerField;
    lbl1: TLabel;
    dbedt1: TDBEdit;
    lbl2: TLabel;
    dbedt2: TDBEdit;
    procedure qPadraoAfterInsert(DataSet: TDataSet);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FCadArea: TFCadArea;

implementation

{$R *.dfm}

procedure TFCadArea.qPadraoAfterInsert(DataSet: TDataSet);
begin
  inherited;
  qPadrao.FieldByName('ARE_CODIGO').AsInteger := DPTOUltimo('AREA', 'ARE_CODIGO','');
end;

end.
